package com.woniuxy.ui;


import java.util.Scanner;

/**
 * @author 作者
 * @create 2025-08-04 12:06
 */
public class Application {


    public static void main(String[] args) {
        showStartMenu();
    }

    public static void showStartMenu() {
        Scanner scanner = new Scanner(System.in);
        System.out.println("欢迎使用xxxxx系统");
        System.out.println("1、登录");
        System.out.println("2、注册");
        System.out.println("3、退出");
        int num = scanner.nextInt();
        switch (num) {
            case 1:
//                System.out.println("执行登录");
                StartMenu.login();
                break;
            case 2:
                StartMenu.regist();
                break;
            case 3:
                System.exit(0);
                break;
            default:
                showStartMenu();
                break;
        }
    }

    public static void showMainMenu() {
        System.out.println("---------欢迎进入系统--------------");
        Scanner scanner = new Scanner(System.in);
        System.out.println("1、学生管理");
        System.out.println("2、教师管理");
        System.out.println("3、注销");
        int num = scanner.nextInt();
        switch (num) {
            case 1:
                showStudentMenu();
                break;
            case 2:
                System.out.println("显示教师管理菜单");
                break;
            case 3:
                //注销，显示开始菜单，重新登录
                showStartMenu();
                break;
            default:
                showMainMenu();
                break;
        }
    }

    private static void showStudentMenu() {
        System.out.println("---------学生管理--------------");
        Scanner scanner = new Scanner(System.in);
        System.out.println("1、查询学生");
        System.out.println("2、添加询学生");
        System.out.println("3、删除询学生");
        System.out.println("4、返回上一级");
        int num = scanner.nextInt();
        switch (num) {
            case 1:
                StudentMenu.getAllStudents();
                showStudentMenu();
                break;
            case 2:
                System.out.println("执行添加学生");
                showStudentMenu();
                break;
            case 3:
                System.out.println("执行删除学生");
                showStudentMenu();
                break;
            case 4:
                showMainMenu();
                break;
            default:
                showStudentMenu();
                break;
        }
    }
}
